import java.util.Scanner;

/**
 * 计算字符串最后一个单词的长度，单词以空格隔开。
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei001 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String input=scanner.nextLine();
            System.out.println(findLastWordLength(input));
        }
        scanner.close();
    }
    public static int findLastWordLength(String input){
        String[] string=input.split(" ");
        int length=string.length;
        return string[length-1].length();
    }

}